/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.bll;

import entity.Event;
import java.sql.SQLException;
import java.util.List;
import model.dal.EventDAL;

/**
 *
 * @author Hailk_c00639
 */
public class EventBLL {

    EventDAL eventDAL = new EventDAL();

    public List<Event> getAllEvent() throws SQLException {
        return eventDAL.getAllEvent();
    }

    public Event getEventByName(String eventName) throws SQLException {
        return eventDAL.getEventByName(eventName);
    }

    public boolean insertEvent(Event event) throws SQLException {
        return eventDAL.insertEvent(event);
    }

    public boolean updateEvent(Event event) throws SQLException {
        return eventDAL.updateEvent(event);
    }

    public boolean deleteEvent(int eventID) {
        try {
            eventDAL.deleteEvent(eventID);

            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public List<Event> searchEventByName(String eventName) throws SQLException {
        return eventDAL.searchEventByName(eventName);
    }
}
